package com.yan.demo.arrydemo;

public class ArrayTest12 {
    public static void main(String[] args) {
        int[] arr = {95, 92, 75, 56, 98, 71, 80, 58, 91, 91};
        int max = arr[0], min = arr[0];
        for (int i = 0; i < arr.length; i++) {
            if(min > arr[i]){
                min = arr[i];
            }
            if(max < arr[i]){
                max = arr[i];
            }
        }
        System.out.println("最大值为" + max);
        System.out.println("最小值为" + min);
    }
}
